package com.servlet.kind;

import com.service.kind.KindServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 创建作者 ：MySunshine
 * 创建时间 2022/10/26 16:27
 * 项目名称 SHUSHAN
 */
@WebServlet("/KindAdd")
public class KindAdd extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        KindServiceImpl ski = new KindServiceImpl();
        String kind = req.getParameter("kind");
        boolean b = ski.kindAdd(kind);
        if (b){
            System.out.println("添加成功！");
            resp.sendRedirect("/page/dba/dbaKindMge.jsp");
    }else {
            System.out.println("添加失败！");
        }
    }
}
